function getUsersRolesAction(){
	return "usersRoles.action";
}

/**
 * 跳转到用户角色页面
 */
function goListRoles(id)
{
	window.showModalDialog(getUsersRolesAction()+"?cmd=list&po.id="+id,window,"menubar=no;toolbar=no");
}

function updateRoles()
{
	$("#userForm").ajaxSubmit( {
		data:{cmd:'update'},
		success : function(returnedData, statusText, xhr, $form) {
			var json = $.evalJSON(returnedData);
			alert(json.msg);
			if(json.processId=='1'){
				window.close();
			}
		}
	});
}

function selectGrant(checkbox){
	if(!checkbox.checked)
		return;
	var roleIds = document.getElementsByName("formMap.roleIds");
	var index = checkbox.parentNode.parentNode.rowIndex - 4;
	if(roleIds[index].checked !== checkbox.checked){
		alert("需要选择对应的角色！");
		checkbox.checked = !checkbox.checked;
	}
}